﻿using System;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;

namespace Assets.XiaoXiao.Script
{
    class ButtonTrigger : MonoBehaviour, IPointerEnterHandler,IPointerExitHandler
    {
        public Image buttonImage;
        private Color defaultColor ;
        public Move moveObj;
        private void Awake()
        {
            defaultColor = buttonImage.color;
        }


        public void OnPointerEnter(PointerEventData eventData)
        {
            if (moveObj.DirectionMove.y < -0.8)
            {
                Debug.Log("有些东西被触发了" + "触发的值为" + moveObj.DirectionMove);
                buttonImage.color = Color.green;

            }
            
        }

        public void OnPointerExit(PointerEventData eventData)
        {
            buttonImage.color = defaultColor;
        }
    }
}
